$(document).ready(function(){
    $('#showcustom').click(function(){
        var custName="data="+$('#searchcutomers option:selected').text();
        $.ajax({
            type:"GET",
            url:"/admin/getcustom",
            data:custName,
            success:function(html) {
                $('#mycustom').html(html);
                }
        });
        return false;
    });

    $('#removeprod').click(function(){
        var prodName="data="+$('#delprod option:selected').text();
         var answer = confirm("Are you sure that you want to delete product "+prodName+"?");
         if(answer)
         {
        $.ajax({
            type:"GET",
            url:"/admin/removeprod",
            data:prodName,
            success:function(html) {
                $('#delproducts').html(html);
                }
        });
         }
        return false;
    });

    $('#editprod').click(function(){
        var prodName="data="+$('#editproducts option:selected').text();
        window.location="/admin/editprod?"+prodName;
        return false;
    });
});




